//
//  Double+Extensions.swift
//  MYDoctor
//
//  Created by Denny on 2024/4/17.
//

import UIKit

extension Double {
    //时间戳->时间
    func toTimeString(formatter: String = "yyyy-MM-dd HH:mm:ss")->String {
        let dateFormatter = DateFormatter()
        dateFormatter.dateFormat = formatter
        dateFormatter.timeZone = TimeZone(abbreviation: "Asia/Shanghai")
        let date = Date(timeIntervalSince1970: self)
        let dateString = dateFormatter.string(from: date)
        return dateString
    }
}
